package xkp.lesson;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ServerSocket serverSocket = new ServerSocket(8888);
        Socket socket = serverSocket.accept();
        ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());
        Person person = (Person) objectInputStream.readObject();
        System.out.println(person);
        objectInputStream.close();
        socket.close();
        serverSocket.close();
    }
}
